useR! 2021 - 2021/07/06

A minimal number of well-known dependencies

mf_map()

mf_map() is the main function of the package.

mf_map(x = sf_object, 
       var = "variable", 
       type = "map type", 
       ...)

mf_map()

Map types

Map types

Map layout

mf_title()
mf_arrow()
mf_credits()
mf_scale()  
mf_layout() 
mf_annotation()     
mf_label()
mf_shadow()

Examples

mtq <- mf_get_mtq()
# Start a map using a theme and extra margins 
mf_init(x = mtq, theme = "dark",
        expandBB = c(0,0,0,.3)) 
# Plot a shadow
mf_shadow(mtq, col = "grey10", add = TRUE)
# Plot a choropleth map
mf_map(x = mtq, var = "MED", type = "choro",
       pal = "Dark Mint", 
       breaks = "quantile", 
       nbreaks = 6, 
       leg_title = "Median Income\n(euros)", 
       leg_val_rnd = -2,
       add = TRUE)
# Add an inset world map
mf_inset_on(x = "worldmap", pos = "right")
mf_worldmap(mtq, col = "#0E3F5C")
mf_inset_off()
# Plot a layout elements
mf_title("Wealth in Martinique, 2015")
mf_credits("T. Giraud\nSources: INSEE & IGN, 2018")
mf_scale(size = 5)
mf_arrow('topleft')

https://riatelab.github.io/mapsf/

Vignettes

Thank You